home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / prog / nextgo23.taz / nextgo23 / NeXTGo / godict.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-09  |  3.0 KB  |  131 lines

  1. #ifndef _GODICT_PROTOS_
  2. #define _GODICT_PROTOS_
  3.  
  4. #include "comment.header"
  5.  
  6. /* #[info:        */
  7. /************************************************************************
  8.  *                                    *
  9.  *               intergo --- An online Go Dictionary            *
  10.  *                                    *
  11.  *                Jan van der Steen                *
  12.  *               Amsterdam, the Netherlands            *
  13.  *                                    *
  14.  *----------------------------------------------------------------------*
  15.  * File    : godict.h                         *
  16.  * Purpose : Define datatypes to implement a Go dictionary        *
  17.  * Version : 1.5                         *
  18.  * Modified: 1/14/93 23:43:08                        *
  19.  * Author  : Jan van der Steen (jansteen@cwi.nl)             *
  20.  ************************************************************************/
  21. /* #]info:        */ 
  22. /* #[define:        */
  23.  
  24. /*  Define the following when comiling the test program  */
  25. #define _TEST_COMPILE_
  26.  
  27. /*
  28.  * Default dictionary (full pathname to file)
  29.  */
  30. #ifndef DEFDICT
  31. #define DEFDICT    "intergo.dct"
  32. #endif
  33.  
  34. /*
  35.  * Special input characters
  36.  */
  37. #define COMMENT '#'             /* Comment indicator */
  38.  
  39. /*
  40.  * Dictionary codes
  41.  */
  42. #define    CD_MISC    0x01
  43. #define    CD_NAME    0x02
  44. #define    CD_CHAM    0x04
  45. #define    CD_TECH    0x08
  46. #define    CD_POLI    0x10
  47. #define    CD_DIGI    0x20
  48.  
  49. /*
  50.  * Dictionary languages
  51.  */
  52. #define    LANG_DG    0x0001
  53. #define    LANG_CP    0x0002
  54. #define    LANG_JP    0x0004
  55. #define    LANG_CH    0x0008
  56. #define    LANG_RK    0x0010
  57. #define    LANG_GB    0x0020
  58. #define    LANG_NL    0x0040
  59. #define    LANG_GE    0x0080
  60. #define    LANG_FR    0x0100
  61.  
  62. /*
  63.  * Type messages
  64.  */
  65. #define MSG_MISC    "Unclassified"
  66. #define MSG_NAME       "Player name"
  67. #define MSG_CHAM       "Championship title"
  68. #define MSG_TECH       "Technical term"
  69. #define MSG_POLI       "Conversation"
  70. #define MSG_DIGI       "Number"
  71.  
  72. /*
  73.  * Language specifiers (while writing)
  74.  */
  75. #define LB_CD        "Type:  "
  76. #define LB_JP        "Japanese:  "
  77. #define LB_CH        "Chinese:  "
  78. #define LB_RK        "Korean:  "
  79. #define LB_GB        "English:  "
  80. #define LB_NL        "Dutch:  "
  81. #define LB_GE        "German:  "
  82. #define LB_FR        "French:  "
  83. #define LB_DG        "Diagram:  "
  84. #define LB_CP        "Caption:  "
  85. #define LB_EOT        "EOT"    /* end of search */
  86.  
  87. /*
  88.  * Language specifiers (while reading)
  89.  */
  90. #   define RD_CD    "CD="
  91. #   define RD_JP    "JP="
  92. #   define RD_CH    "CH="
  93. #   define RD_RK    "RK="
  94. #   define RD_GB    "GB="
  95. #   define RD_NL    "NL="
  96. #   define RD_GE    "GE="
  97. #   define RD_FR    "FR="
  98. #   define RD_DG    "DG="
  99. #   define RD_CP    "CP="
  100.  
  101. #define MAXDICTLINE    1024
  102.  
  103. /* #]define:        */ 
  104. /* #[typedef:        */
  105.  
  106. typedef struct dict_node {
  107.     struct dict_node *    dct_next;
  108.     char *        dct_jp;        /* Japanese        */
  109.     char *        dct_gb;        /* English        */
  110.     char *        dct_ch;        /* Chinese        */
  111.     char *        dct_rk;        /* Korean        */
  112.     char *        dct_nl;        /* Dutch        */
  113.     char *        dct_ge;        /* German        */
  114.     char *        dct_fr;        /* French        */
  115.     char *        dct_dg;        /* Diagram        */
  116.     char *        dct_cp;        /* Caption        */
  117.     char *        dct_spec;    /* Only for clients    */
  118.     int            dct_type;    /* See defines        */
  119. } GODICT;
  120.  
  121. /*
  122.  * Loading and Searching routines.
  123.  */
  124. extern GODICT* load_dict(char* filename);
  125. extern void store_dict(char **f, char *s);
  126. extern char* lstr(char *s);
  127. extern GODICT* search_dict(GODICT* gd, char* term);
  128.  
  129. #endif
  130.  
  131.